home *** CD-ROM | disk | FTP | other *** search
- on setKitchenRearDoorIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #kitchenRearDoorIsOpen)
- set currentRoom to the gHotSublist of oPuppeteer
- if (suggestion = 0) and (currentState = 1) then
- set the queuedSound of oPuppeteer to #kitchenExitClose
- setProp(the lsStateData of oStoryteller, #kitchenRearDoorIsOpen, [0])
- updateDisplay(oPuppeteer)
- if (currentRoom = #DarkDn) or (currentRoom = #kitchen) then
- endLoop(#grounds)
- end if
- if currentRoom = #Ghse then
- endLoop(#houseHum)
- end if
- if (currentRoom = #kitchen) and (getState(oStoryteller, #DoorWithScanUnit) = #kitchenOutside) and (getState(oStoryteller, #scanUnitIsActive) = 1) then
- endLoop(#scanLoop)
- end if
- end if
- if (suggestion = 1) and (currentState = 0) then
- set the queuedSound of oPuppeteer to #kitchenExitOpen
- setProp(the lsStateData of oStoryteller, #kitchenRearDoorIsOpen, [1])
- updateDisplay(oPuppeteer)
- if (currentRoom = #DarkDn) or (currentRoom = #kitchen) then
- setLoop(#grounds, 180)
- end if
- if (currentRoom = #kitchen) and (getState(oStoryteller, #DoorWithScanUnit) = #kitchenOutside) and (getState(oStoryteller, #scanUnitIsActive) = 1) then
- setLoop(#scanLoop, 120)
- end if
- end if
- end
-
- on setBoathouseDoorIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #boatHouseDoorIsOpen)
- if (suggestion = 0) and (currentState = 1) then
- set the queuedSound of oPuppeteer to #cabinetClose
- setProp(the lsStateData of oStoryteller, #boatHouseDoorIsOpen, [0])
- killVideo()
- updateDisplay(oPuppeteer)
- end if
- if (suggestion = 1) and (currentState = 0) then
- set the queuedSound of oPuppeteer to #cabinetOpen
- setProp(the lsStateData of oStoryteller, #boatHouseDoorIsOpen, [1])
- updateDisplay(oPuppeteer)
- end if
- end
-
- on setFrontDoorIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #FrontDoorIsOpen)
- set currentRoom to the gHotSublist of oPuppeteer
- if (suggestion = 0) and (currentState = 1) then
- set the queuedSound of oPuppeteer to #frontDoorClose
- setProp(the lsStateData of oStoryteller, #FrontDoorIsOpen, [0])
- updateDisplay(oPuppeteer)
- if (currentRoom = #DarkDn) or (currentRoom = #Hall) then
- endLoop(#grounds)
- end if
- if currentRoom = #Porch then
- endLoop(#houseHum)
- end if
- end if
- if (suggestion = 1) and (currentState = 0) then
- set the queuedSound of oPuppeteer to #frontDoorOpen
- setProp(the lsStateData of oStoryteller, #FrontDoorIsOpen, [1])
- updateDisplay(oPuppeteer)
- if (currentRoom = #DarkDn) or (currentRoom = #Hall) then
- setLoop(#grounds, 180)
- end if
- if currentRoom = #Porch then
- setLoop(#houseHum, 80)
- end if
- end if
- end
-
- on setBalconyDoorIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #balconyDoorIsOpen)
- set currentLoc to getState(oStoryteller, #currentLocation)
- if (suggestion = 0) and (currentState = 1) then
- set the queuedSound of oPuppeteer to #doorClose
- setProp(the lsStateData of oStoryteller, #balconyDoorIsOpen, [0])
- updateDisplay(oPuppeteer)
- if getPos([#UHallBalconyEntry, #UHallNwall2, #DarkUp_UHallNwall2, #DarkUp_BalcEntry], currentLoc) then
- endLoop(#grounds)
- end if
- if getPos([#UHallBalconyN, #UHallBalconyS, #DarkUp_BalcNorth, #DarkUp_BalcSouth], currentLoc) then
- endLoop(#houseHum)
- end if
- end if
- if (suggestion = 1) and (currentState = 0) then
- set the queuedSound of oPuppeteer to #doorOpen
- setProp(the lsStateData of oStoryteller, #balconyDoorIsOpen, [1])
- updateDisplay(oPuppeteer)
- if getPos([#UHallBalconyEntry, #UHallNwall2, #DarkUp_UHallNwall2, #DarkUp_BalcEntry], currentLoc) then
- setLoop(#grounds, 180)
- end if
- if getPos([#UHallBalconyN, #UHallBalconyS, #DarkUp_BalcNorth, #DarkUp_BalcSouth], currentLoc) then
- setLoop(#houseHum, 80)
- end if
- end if
- end
-
- on setFortiesBedroomDoorIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #FortiesBedroomDoorIsOpen)
- if (suggestion = 0) and (currentState = 1) then
- set the queuedSound of oPuppeteer to #doorClose
- setProp(the lsStateData of oStoryteller, #FortiesBedroomDoorIsOpen, [0])
- updateDisplay(oPuppeteer)
- end if
- if (suggestion = 1) and (currentState = 0) then
- set the queuedSound of oPuppeteer to #doorOpen
- setProp(the lsStateData of oStoryteller, #FortiesBedroomDoorIsOpen, [1])
- updateDisplay(oPuppeteer)
- end if
- end
-
- on setBathroomDoorIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #bathroomDoorIsOpen)
- if (suggestion = 0) and (currentState = 1) then
- set the queuedSound of oPuppeteer to #doorClose
- setProp(the lsStateData of oStoryteller, #bathroomDoorIsOpen, [0])
- updateDisplay(oPuppeteer)
- end if
- if (suggestion = 1) and (currentState = 0) then
- set the queuedSound of oPuppeteer to #doorOpen
- setProp(the lsStateData of oStoryteller, #bathroomDoorIsOpen, [1])
- updateDisplay(oPuppeteer)
- end if
- end
-
- on setGarageDoorIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #GarageDoorIsOpen)
- set currentRoom to the gHotSublist of oPuppeteer
- if (suggestion = 0) and (currentState = 1) then
- soundEffect(#garageDoorClose)
- wait(15)
- setProp(the lsStateData of oStoryteller, #GarageDoorIsOpen, [0])
- updateDisplay(oPuppeteer)
- if currentRoom = #Garage then
- endLoop(#grounds, 80)
- else
- endLoop(#Garage)
- end if
- end if
- if (suggestion = 1) and (currentState = 0) then
- soundEffect(#garageDoorOpen)
- wait(10)
- setProp(the lsStateData of oStoryteller, #GarageDoorIsOpen, [1])
- updateDisplay(oPuppeteer)
- if currentRoom = #Garage then
- setLoop(#grounds, 180)
- else
- setLoop(#Garage, 120)
- end if
- end if
- end
-
- on setShowerDoorIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #showerDoorIsOpen)
- if (suggestion = 0) and (currentState = 1) then
- set the queuedSound of oPuppeteer to #showerClose
- setProp(the lsStateData of oStoryteller, #showerDoorIsOpen, [0])
- updateDisplay(oPuppeteer)
- end if
- if (suggestion = 1) and (currentState = 0) then
- set the queuedSound of oPuppeteer to #showerOpen
- setProp(the lsStateData of oStoryteller, #showerDoorIsOpen, [1])
- updateDisplay(oPuppeteer)
- end if
- end
-
- on setMailboxIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #mailboxIsOpen)
- if (suggestion = 0) and (currentState = 1) then
- set the queuedSound of oPuppeteer to #mailboxClose
- setProp(the lsStateData of oStoryteller, #mailboxIsOpen, [0])
- updateDisplay(oPuppeteer)
- end if
- if (suggestion = 1) and (currentState = 0) then
- set the queuedSound of oPuppeteer to #mailboxOpen
- setProp(the lsStateData of oStoryteller, #mailboxIsOpen, [1])
- updateDisplay(oPuppeteer)
- end if
- end
-
- on setStudyDrawerIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #studyDrawerIsOpen)
- if (suggestion = 0) and (currentState = 1) then
- set the queuedSound of oPuppeteer to #drawerClose
- setProp(the lsStateData of oStoryteller, #studyDrawerIsOpen, [0])
- updateDisplay(oPuppeteer)
- end if
- if (suggestion = 1) and (currentState = 0) then
- set the queuedSound of oPuppeteer to #drawerOpen
- setProp(the lsStateData of oStoryteller, #studyDrawerIsOpen, [1])
- updateDisplay(oPuppeteer)
- end if
- end
-
- on setOfficeDrawerIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #officeDrawerIsOpen)
- if (suggestion = #none) and (currentState <> #none) then
- set the queuedSound of oPuppeteer to #OfficeDrawerClose
- setProp(the lsStateData of oStoryteller, #officeDrawerIsOpen, [suggestion])
- updateDisplay(oPuppeteer)
- end if
- if (suggestion <> #none) and (currentState = #none) then
- set the queuedSound of oPuppeteer to #OfficeDrawerOpen
- setProp(the lsStateData of oStoryteller, #officeDrawerIsOpen, [suggestion])
- updateDisplay(oPuppeteer)
- end if
- end
-
- on setDiningRmCabinetIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #diningRmCabinetIsOpen)
- if (suggestion = #none) and (currentState <> #none) then
- set the queuedSound of oPuppeteer to #sideboardClose
- setProp(the lsStateData of oStoryteller, #diningRmCabinetIsOpen, [suggestion])
- updateDisplay(oPuppeteer)
- end if
- if (suggestion <> #none) and (currentState = #none) then
- set the queuedSound of oPuppeteer to #sideboardOpen
- setProp(the lsStateData of oStoryteller, #diningRmCabinetIsOpen, [suggestion])
- updateDisplay(oPuppeteer)
- end if
- end
-
- on setBedrmCabinetIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #bedrmCabinetIsOpen)
- if (suggestion = #none) and (currentState <> #none) then
- if getPos([#bureau1, #bureau2, #bureau3, #leftTable, #rightTable], currentState) then
- set the queuedSound of oPuppeteer to #drawerClose
- end if
- if currentState = #armoire then
- set the queuedSound of oPuppeteer to #cabinetClose
- end if
- if currentState = #closet then
- set the queuedSound of oPuppeteer to #doorClose
- end if
- setProp(the lsStateData of oStoryteller, #bedrmCabinetIsOpen, [suggestion])
- updateDisplay(oPuppeteer)
- end if
- if (suggestion <> #none) and (currentState = #none) then
- if getPos([#bureau1, #bureau2, #bureau3, #leftTable, #rightTable], suggestion) then
- set the queuedSound of oPuppeteer to #drawerOpen
- end if
- if suggestion = #armoire then
- set the queuedSound of oPuppeteer to #cabinetOpen
- end if
- if suggestion = #closet then
- set the queuedSound of oPuppeteer to #doorOpen
- end if
- setProp(the lsStateData of oStoryteller, #bedrmCabinetIsOpen, [suggestion])
- updateDisplay(oPuppeteer)
- end if
- end
-
- on setKitchenCabinetIsOpen suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #kitchenCabinetIsOpen)
- if (suggestion = #none) and (currentState <> #none) then
- if getPos([#upperLeft, #upperMiddle, #upperRight, #lowerLeft, #lowerMiddle, #lowerRight, #cupboard], currentState) then
- set the queuedSound of oPuppeteer to #cabinetClose
- else
- if currentState = #trashcan then
- set the queuedSound of oPuppeteer to #cabinetClose
- end if
- if currentState = #drawer then
- set the queuedSound of oPuppeteer to #drawerClose
- end if
- if currentState = #silverDrawer then
- set the queuedSound of oPuppeteer to #silverDrawerClose
- end if
- end if
- setProp(the lsStateData of oStoryteller, #kitchenCabinetIsOpen, [suggestion])
- updateDisplay(oPuppeteer)
- end if
- if (suggestion <> #none) and (currentState = #none) then
- if getPos([#upperLeft, #upperMiddle, #upperRight, #lowerLeft, #lowerMiddle, #lowerRight, #cupboard], suggestion) then
- set the queuedSound of oPuppeteer to #cabinetOpen
- else
- if suggestion = #drawer then
- set the queuedSound of oPuppeteer to #drawerOpen
- end if
- if suggestion = #silverDrawer then
- set the queuedSound of oPuppeteer to #silverDrawerOpen
- end if
- end if
- setProp(the lsStateData of oStoryteller, #kitchenCabinetIsOpen, [suggestion])
- updateDisplay(oPuppeteer)
- end if
- if suggestion = #trashcan then
- set the queuedSound of oPuppeteer to #drawerOpen
- setProp(the lsStateData of oStoryteller, #kitchenCabinetIsOpen, [suggestion])
- updateDisplay(oPuppeteer)
- end if
- end
-
- on testForMargGhost
- global oPuppeteer, oStoryteller, gCPU
- set activeHaunts to getProp(the lsStateData of oStoryteller, #hauntsRemaining)
- if getPos(activeHaunts, #ghostBrushingHair) then
- cursorOff()
- if gCPU = #PC then
- suspendSounds(#fadeOut)
- end if
- pushVideo()
- wait(#videoStop)
- if gCPU = #PC then
- restoreSounds(#fadeIn)
- end if
- trimState(#hauntsRemaining, #ghostBrushingHair)
- end if
- end
-
- on testForMirrorMsg
- global oPuppeteer, oStoryteller, gCPU
- set activeHaunts to getProp(the lsStateData of oStoryteller, #hauntsRemaining)
- if getPos(activeHaunts, #mirrorMessage) then
- cursorOff()
- if gCPU = #PC then
- suspendSounds(#fadeOut)
- end if
- pushVideo()
- wait(#videoStop)
- if gCPU = #PC then
- restoreSounds(#fadeIn)
- end if
- trimState(#hauntsRemaining, #mirrorMessage)
- end if
- end
-
- on setDoorWithScanUnit suggestion
- global oStoryteller, oPuppeteer
- set validKnobs to [#none, #kitchenOutside, #kitchenInside, #margaretRmInside, #margaretRmOutside, #bathroomInside, #bathroomOutside, #garageInside, #garageOutside, #boathouseInside, #boatHouseOutside]
- if getPos(validKnobs, suggestion) <> 0 then
- set oldValue to getState(oStoryteller, #DoorWithScanUnit)
- if (suggestion = #none) and (oldValue <> #none) then
- set the queuedSound of oPuppeteer to #scanOffKnob
- end if
- if (suggestion <> #none) and (oldValue = #none) then
- set the queuedSound of oPuppeteer to #scanOntoKnob
- end if
- setProp(the lsStateData of oStoryteller, #DoorWithScanUnit, [suggestion])
- else
- put "Sorry, " & suggestion & " isn't a valid knob for the state-var #doorWithScanUnit.."
- end if
- end
-